#pragma once

#include "Deliverables.h"
#include <queue>
using std::queue;

typedef void (*MESSAGEPROC)(CMessage*);



class MailSystem
{
private:
	queue<CMessage*>			m_MsgQueue;				
	MESSAGEPROC					m_pfnMsgSys;			

	MailSystem() { m_pfnMsgSys = NULL;}
	MailSystem(const MailSystem&);
	MailSystem& operator=(const MailSystem&);

	~MailSystem() {}

public:
	
	static MailSystem* GetInstance();
	inline int GetNumMessages() { return (int)m_MsgQueue.size(); }
	void InitMessageSystem(MESSAGEPROC m_pfnMsgSys);
	void SendMail(CMessage* pMsg);
	void ReadMail();
	void ClearMessages();
	void ShutdownMailSystem();
};